import request from './request'

//登录接口
export function login (data) {
  return request({
    url: 'TwoApi/login/',
    method: 'post',
    data: data
  })
}
//注册接口
export function register (data) {
  return request({
    url: 'TwoApi/Rigister/',
    method: 'post',
    data: data
  })
}

//全局uuid接口
export function vcodeUuid (data) {
  return request({
    url: 'TwoApi/imagecode/?uuid=' + data,
    method: 'get',
    data: data
  })
}

//获取验证码接口
export function vcodeImg (data) {
  return request({
    url: 'TwoApi/imgCode',
    method: 'get',
    data: data
  })
}

//获取gitlab 参数接口
export const gitlabList = data => {
  return request({
    url: "TwoApi/listProject/",
    method: 'get',
    params: data
  })
}

//手动录入主机信息接口
export function manualInfo (data) {
  return request({
    url: "TwoApi/manualinfo/",
    method: "post",
    data: data
  })
}
// 上传execfile文件到后台接口

export function execFile (data) {
  return request({
    url: "TwoApi/upload/",
    method: "post",
    data: data
  })
}

// 获取上传exec录入数据

export function exdata (data) {
  return request({
    url: "TwoApi/exdata/",
    method: "post",
    data: data

  })
}
// 执行页面传递的参数到后台执行

export function andhoc (data) {
  return request({
    url: "ansible/andhoc/",
    method: "post",
    data: data
  })
}
// 扫描主机状态和开放端口

export function execute (data) {
  return request({
    url: "TwoApi/scan/",
    method: "post",
    data: data,
    async: false,
  })
}
// 获取华为云的api接口
// 获取华为云的资源池
export function listZones (data) {
  return request({
    url: "TwoApi/listZones/",
    method: "post",
    data: data,
    async: false
  })
}
// 获取华为云资源serviers的资源
export function listServers (data) {
  return request({
    url: "TwoApi/listServers/",
    method: "post",
    data: data,
    async: false
  })
}

// get gitlab projects 

export function getGitlabJob (data) {
  return request({
    url: "TwoApi/ops/projectsList/",
    method: "get",
    data: data,
    async: false,
    dataType: 'application/json'
  })
}

// get gitlab jobs

export function pipelineJobs (data) {
  return request({
    url:"TwoApi/ops/pipelineJobs/",
    method:"get",
    data: data,
    async: false,
    dataType: 'application/json'
  })
}

// change get schedules data

export function pipelineScheduleList(data) {
  return request({
    url: "TwoApi/ops/pipelineSchedules/",
    method: "get",
    data: data,
    async: false,
    dataType: 'application/json'
  })
}